package com.example.logisticsservice.Listen;

import com.example.orderservice.module.OrderInfo;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@RabbitListener(queues = "orderQueue")
@Component
public class orderListener {

    @RabbitHandler // RabbitListener为类注解的时候需要加上这个 会分别信息的类型
    public void receive(String orderInfo){
        System.out.println("接收到消息String: "+orderInfo);
    }

    @RabbitHandler // RabbitListener为类注解的时候需要加上这个
    public void receive(OrderInfo orderInfo){
        System.out.println("接收到消息OrderInfo: "+orderInfo);
    }
}
